
var images_url = "images";
var ie4 = document.all;
var ns6 = document.getElementById;

function removeElement(id) {
	var Node = document.getElementById(id);
	Node.parentNode.removeChild(Node);
}

function submitOnEnter(myform) {
	if (window.event && window.event.keyCode == 13) {
		myform.submit();
	} else {
		return true;
	}
}
function ShowImage(Image) {
	var ContentObj = document.getElementById ? document.getElementById("GiftShow2") : document.all.GiftShow2;
	File = Image.split(";")[0];
	if (File != "") {
		if (ie4 || ns6) {
			ContentObj.innerHTML = "<center>Loading image...</center>";
			ContentObj.innerHTML = "<center><img src=\"" + images_url + "/" + File + "\"></center>";
		} else {
			if (document.layers) {
				document.GiftShow.document.GiftShow1.document.write("<center><img src=\"" + images_url + "/" + File + "\"></center>");
				document.GiftShow.document.GiftShow1.document.close();
			} else {
				alert("You need NS 4+ or IE 4+ to view the images!");
			}
		}
	} else { // Clear image
		if (ie4 || ns6) {
			ContentObj.innerHTML = " ";
		} else {
			if (document.layers) {
				document.GiftShow.document.GiftShow1.document.write(" ");
				document.GiftShow.document.GiftShow1.document.close();
			} else {
				alert("You need NS 4+ or IE 4+ to view the images!");
			}
		}
	}
}
function wantToDeleteWithURL(url, msg) {
	var where_to = confirm(msg);
	if (where_to == true) {
		window.location.href = url;
	}
}
function wantToDelete(msg) {
	return confirm(msg);
}

function CheckCheckAll(Check_ctr, chk) {
	if (Check_ctr.checked == true) {
		chk.checked = true;
		for (i = 0; i < chk.length; i++) {
			chk[i].checked = true;
		}
	} else {
		chk.checked = false;
		for (i = 0; i < chk.length; i++) {
			chk[i].checked = false;
		}
	}
}

function checkAll(chk){
	for (i = 0; i < chk.length; i++) {
			chk[i].checked = true;
	}
}
function disableTextBoxesOnClicks(views, days, clicks){
	views.disabled=true;
	views.value="";
	days.disabled=true;
	days.value="";
	clicks.disabled=false;
}

function disableTextBoxesOnViews(views, days, clicks){
	clicks.value="";
	clicks.disabled=true;
	days.value="";
	days.disabled=true;

	views.disabled=false;
}
function disableTextBoxesOnDays(views, days, clicks){
	views.disabled=true;
	views.value="";
	clicks.disabled=true;
	clicks.value="";
	days.disabled=false;
}